<?php

namespace app\model;

use think\Model;

/**
 *
 */
class Rule extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'casbin_rule';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $pk = 'id';

    public function addRule($data = []){
        $rule = Rule::create($data);
        return $rule->id;
    }

    public function findData($id = null){
        $rule = Rule::find($id);
        return $rule;
    }
}
